package com.aiwei.tdjk.dao.extend;

import com.aiwei.tdjk.dao.mbg.GroupRelationMapper;
import com.aiwei.tdjk.dto.request.GetGroupRelationPagerRequest;
import com.aiwei.tdjk.entity.GroupRelation;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;


public interface GroupRelationExtendMapper extends GroupRelationMapper{

    List<Long> findGroupIdsByUserId(@Param("userId") Long userId);

    List<Long> findGroupIds(@Param("userId") Long userId, @Param("organizationIds") Set<Long> organizationIds);

    /**
     * 根据分组id查询分组关系
     *
     * @param request
     * @return
     */
    List<GroupRelation> findAllByGroupId(GetGroupRelationPagerRequest request);

    /**
     * 根据分组id查询分组数量
     *
     * @param request
     * @return
     */
    int findAllByGroupIdCount(GetGroupRelationPagerRequest request);

    /**
     * 根据分组名获取该分组下的用户
     *
     * @param groupName
     * @return
     */
    List<Long> getUserIdsByGroupName(String groupName);

}